package com.atguigu.spzx.user.mapper;

import com.atguigu.spzx.common.entity.UserInfo;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

/**
 * <p>
 * 会员表 Mapper 接口
 * </p>
 *
 * @author flyduck
 * @since 2023-11-04
 */
public interface UserInfoMapper extends BaseMapper<UserInfo> {

    /**
     * 根据username查询
     * @param username
     * @return
     */
    default UserInfo getUserInfoByUserName(String username){
        QueryWrapper<UserInfo> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("username", username);
        return this.selectOne(queryWrapper);
    }
}
